<?php

namespace xinsheng\api\v1;

use xinsheng\Request;

class Pay extends Request
{
    public function __construct(array $data = [])
    {
        parent::__construct($data);
    }

    //支付申请（API 模式）
    public function apiPay(array $data=[]){
        $this->type='POST';
        $this->serCode='101005';


        $this->content= array_merge($this->content,$data);
        return $this->exec();
    }

    //银行卡bin
    public function cardBin(array $data=[]){
        $this->type='POST';
        $this->serCode='101002';

        $this->content= array_merge($this->content,$data);
        return $this->exec();
    }

    //报关申请
    //用于在新生完成支付的网关订单，做为海关支付单推单。
    public function customsApply(array $data=[]){
        $this->type='POST';
        $this->serCode='101017';

        $this->content= array_merge($this->content,$data);
        return $this->exec();
    }

    //订单查询
    public function orderQuery(array $data=[]){
        $this->type='POST';
        $this->serCode='101007';

        $this->content= array_merge($this->content,$data);
        return $this->exec();
    }

    //撤销、退款
    public function refund($orderId, array $data=[]){
        $this->type='POST';
        $this->serCode='101006';
        $this->orderId = $orderId;

        $this->content= array_merge($this->content,$data);
        return $this->exec();
    }
}